
<div class="col-sm-12">
	<div class="box margin-middle max-width">
		<!-- BOX-BODY -->
		<div class="box-body pb40">
			{{#bs-form formLayout=formLayout class='pb40' model=nurseGroupModel invalid=(action "invalid")}}
			<div class="row">
				<div class="col-xs-12">
					<p class="user-add-btn inline-block">
						{{#if detailEdit}}
						{{else}}
							{{#ui/form-function editAction="detailEditClick" detailEditClick="detailEditClick"
							removeAction="delById" delById="delById"}}
							{{/ui/form-function}}
						{{/if}}
					</p>
				</div>
				<!-- 列表详细介绍 -->
				<div class="col-xs-12 nopadding-left">
					<div class="col-xs-12 nopadding-horizontal mt20">
						<!--小组名称-->
						<div class="col-xs-6 col-sm-6 ">
							<div class="col-xs-12 col-sm-12 nopadding-left">
								<div class="form-input-group">
									<span class="input-group-addon">小组名称：</span>
									{{#if detailEdit}}
										{{#if id}}
											{{bs-form-element property="name" class="inline-block form-input-group label-normal" controlType="name" placeholder='小组名称(必填)'}}
										{{else}}
											{{bs-form-element property="name" class="inline-block form-input-group label-normal" controlType="name" placeholder='小组名称(必填)'}}
										{{/if}}
									{{else}}
										<div class="input-group-content">{{nurseGroupModel.name}}</div>
									{{/if}}
								</div>
							</div>
							<div class="col-sm-12 nopadding-left">
									{{#if detailEdit}}
										<div class="col-sm-12 nopadding-left nopadding-right mt30">
										<div class="col-xs-6 col-sm-6 nopadding-right nopadding-left">
				              <div class="form-input-group">
				                <span class="input-group-addon">已选成员：</span>
				              </div>
				            </div>
										<!--组长-->
				            <div class="col-xs-6 col-sm-6 nopadding-right">
				              <div class="form-input-group">
				                <span class="input-group-addon">组长：</span>
				                {{#power-select class="input-group-content" placeholder="选择组长" options=leaderList  selected=defaultLeader searchField="namePinyin"
				                  noMatchesMessage="没有相关内容" allowClear=false onchange=(action "selectLeader" ) as |leader|}}
				                  {{leader.name}}
				                {{/power-select}}
				              </div>
				            </div>
											{{#if chooseStaff}}
											<div class="col-sm-12 border pt10">
												{{#each chooseStaff as |nurse|}}
														{{ui/choose-lable class="room col-sm-3" text=nurse.employee.name hasSelected=nurse.selected
														itemSelect="changeStaffBack" code=nurse.staffId }}
												{{/each}}
											</div>
											{{else}}
												<div class="col-sm-12 border pt10">请选择组员</div>
											{{/if}}
									</div>
										<!--未选成员-->
										<div class="col-sm-12 nopadding-left nopadding-right">
		                <span class="col-sm-12 nopadding-left nopadding-right" style="font-size:14px;color:#333;line-height:30px;">未选成员：</span>
										<div class="col-sm-12 border pt10">
											{{#each staffNameList as |nurse|}}
											{{ui/choose-lable class="nurse col-sm-3" text=nurse.name hasSelected=nurse.selected
											itemSelect="changeStaffType" code=nurse.staffId }}
											{{/each}}
										</div>
									</div>
									{{else}}

									{{/if}}
							</div>
						</div>

					{{#if detailEdit}}
					<div class="col-sm-6" style="clear:none;">
						<div class="col-sm-12 nopadding-left" style="font-size:14px;color:#333;">护理老人选择：<span style="font-size:13px;">当前已选择{{customerNum}}个老人,{{chooseBeds.length}}个床位</span></div>
						<div class="col-sm-12  border mt10" >
							<div class="tree tree-selectable" id='tree'>
								{{#each treeList as |build|}}
									<div class="tree-folder">
										<div class="tree-folder-header {{if build.hasSelected 'tree-selected'}}">
											<i class="fa {{if build.checked 'fa-minus' 'fa-plus'}}" {{action 'checkbuild' build on="click"}}></i>
											{{#if detailEdit}}
											<i class="fa {{if build.hasSelected 'fa-check' 'fa-square-o'}}" {{action 'choosebuild' build on="click"}}></i>
											{{/if}}
											<div class="tree-folder-name">{{build.name}}</div>
										</div>
										{{#if build.checked}}
										<div class="tree-folder-content">
											{{#each build.children as |floor|}}
											<div class="tree-folder">
												<div class="tree-folder-header {{if floor.hasSelected 'tree-selected'}}">
													<i class="fa {{if floor.checked 'fa-minus' 'fa-plus'}}" {{action 'checkfloor' floor on="click"}}></i>
													{{#if detailEdit}}
													<i class="fa {{if floor.hasSelected 'fa-check' 'fa-square-o'}}" {{action 'choosefloor' floor on="click"}}></i>
													{{/if}}
													<div class="tree-folder-name">{{floor.name}}</div>
												</div>
												{{#if floor.checked}}
												<div class="tree-folder-content">
													{{#each floor.children as |room|}}
													<div class="tree-folder">
														<div class="tree-folder-header {{if room.hasSelected 'tree-selected'}}">
															<i class="fa {{if room.checked 'fa-minus' 'fa-plus'}}" {{action 'checkroom' room on="click"}}></i>
															{{#if detailEdit}}
															<i class="fa {{if room.hasSelected 'fa-check' 'fa-square-o'}}" {{action 'chooseroom' room on="click"}}></i>
															{{/if}}
															<div class="tree-folder-name">{{room.name}}</div>
														</div>
														{{#if room.checked}}
														<div class="tree-folder-content">
															{{#each room.children as |bed index|}}
															{{#if (eq bed.name 'PDD')}}
															{{log 'bed is:' bed}}
															{{/if}}
															<div class="tree-item {{if bed.hasSelected 'tree-selected' ''}}">
																	{{#if detailEdit}}
																	<i id={{bed.order}} class="fa {{if bed.hasSelected 'fa-check' 'fa-square-o'}}" {{action 'checkbed' bed on="click"}}></i>
																	{{/if}}
																	<div class="tree-item-name">{{bed.name}}</div>
															</div>
															{{/each}}
														</div>
														{{/if}}
													</div>
													{{/each}}
												</div>
												{{/if}}
											</div>
											{{/each}}
										</div>
										{{/if}}
									</div>
								{{/each}}
							</div>
							</div>
						</div>
						{{else}}
						<div class="col-xs-6 col-sm-6 nowrap" style="max-width:50%;">
							<div class="form-input-group">
								<span class="input-group-addon">护理老人：</span>
								<div class="input-group-content nowrap" style="max-width:400px;">{{nurseGroupModel.customerName}}</div>
							</div>
						</div>
						<div class="col-xs-6 col-sm-6 nopadding-right">
							<div class="form-input-group">
								<span class="input-group-addon">组长：</span>
								<div class="input-group-content">{{nurseGroupModel.leader.name}}</div>
							</div>
						</div>
						<div class="col-xs-6 col-sm-6 nopadding-right">
							<div class="form-input-group">
								<span class="input-group-addon">已选成员：</span>
								<div class="input-group-content">{{nurseGroupModel.member}}</div>
							</div>
						</div>
						{{/if}}
					</div>
					</div>
				</div>
				<!-- 列表详细介绍 -->
				<div class="col-sm-12">
				<div class="text-center mt30">
						<p class="text-center user-add-btn" style="display:inline-block;margin:0 auto!important ">
						{{#if detailEdit}}
						{{#ui/mix-button class="user-btn edit-btn" iconClass="fa fa-check"  text='保存' clickAction="saveNurseGroup" saveNurseGroup="saveNurseGroup"}}
						{{/ui/mix-button}}
						{{#ui/mix-button class="user-btn times-btn" iconClass="fa fa-mail-reply"  text='取消'  clickAction="detailCancel" detailCancel="detailCancel" }}
						{{/ui/mix-button}}
						{{else}}
						{{/if}}
						</p>
				</div>
				</div>
				{{/bs-form}}

			</div>


		<!-- /BOX-BODY -->
	</div>
</div>

{{#if showpopInvitePassModal}}
	{{#bs-modal body=false footer=false header=false}}
		{{#bs-modal-header}}
			<h3 class="modal-title">删除提示</h3>
		{{/bs-modal-header}}
		{{#bs-modal-body}}
			<h4 class="modal-title">是否删除该条记录？</h4>
		{{/bs-modal-body}}

		{{#bs-modal-footer as |footer|}}
			{{#bs-button action=(action "cancelPassSubmit" nurseGroupModel) type="primary" disabled=prepaidDisabled}}确定{{/bs-button}}
			{{#bs-button action=(action "invitation") type="default"}}取消{{/bs-button}}
		{{/bs-modal-footer}}
	{{/bs-modal}}
{{/if}}
